<!DOCTYPE html>
<html>
<head>
	<title><?php echo $desc." | ".$title ?></title>
	<?php $this->load->view('assets-importer'); ?>
	<link href="<?php echo base_url('asset/pow/css/pow.css') ?>" rel="stylesheet"/>
	<link href="<?php echo base_url('asset/pow/css/pow-mediaqueries.css') ?>" rel="stylesheet"/>
</head>
<body>
	<?php $this->load->view('nav'); ?>

	<div id="outer">
		<div class="container">
			<!--Post Kiri [tampilan besar]-->	
			<?php $tot_post = count($post); ?>
			<?php if($tot_post == 1): ?>
				<?php $bts1 = ceil($tot_post / 3); ?>
				<?php $bts2 = ceil($bts1 * 2); ?>
				<?php $bts3 = ceil($bts1 * 3); ?>
			<?php else: ?>
				<?php $bts1 = round($tot_post / 3); ?>
				<?php $bts2 = round($bts1 * 2); ?>
				<?php $bts3 = round($bts1 * 3); ?>
			<?php endif; ?>
			<?php //echo "Total : $tot_post <br/>Batas1: $bts1<br/>Batas2: $bts2<br/>Batas3: $bts3<br/>" ?>			
			
			<?php $tot_post_num = 1; ?>
			<div class="col-md-4 col-sm-4 menpad">		
				<?php foreach($post as $post_rec): ?>
					<?php  
					$post_id = $post_rec['jonu_post_id'];
					$post_tgl = substr($post_rec['jonu_post_date'], 8,2);
					$post_bln = substr($post_rec['jonu_post_date'], 5,2);
					$permalink = $post_bln.'/'.$post_tgl.'/'.$post_id.'/'.$post_rec['jonu_post_permalink'];						
					?>

					<?php if($tot_post_num <= $bts1): ?>	
						<div class="hoybox">
							<div class="imghoypost">
								<img src="<?php echo base_url("asset/img/posts-image/$post_rec[jonu_post_image]") ?>" width="100%">
								<div class="katlbl"><?php echo $post_rec['jonu_post_view'] ?> <i class="fa fa-eye"></i></div>
							</div>
							<div class="hoypostdes">
								<h2 class="pow-title">
									<a href="<?php echo site_url("post/show/$permalink") ?>"><?php echo $post_rec['jonu_post_title'] ?></a>
								</h2>
							</div>
							<div class="hoysharedbox">									
								<a href="#" class="sharditem"><i class="fa fa-fw fa-twitter"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-facebook"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-down"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-up"></i></a>									
							</div>
						</div>			

					<?php endif; ?>
					<?php $tot_post_num++; ?>
				<?php endforeach; ?>
			</div>

			<?php $tot_post_num = 1; ?>
			<div class="col-md-4 col-sm-4 menpad">
				<?php foreach($post as $post_rec): ?>
					<?php  
					$post_id = $post_rec['jonu_post_id'];
					$post_tgl = substr($post_rec['jonu_post_date'], 8,2);
					$post_bln = substr($post_rec['jonu_post_date'], 5,2);
					$permalink = $post_bln.'/'.$post_tgl.'/'.$post_id.'/'.$post_rec['jonu_post_permalink'];						
					?>
					<?php if($tot_post_num > $bts1 && $tot_post_num <= $bts2): ?>					
						<div class="hoybox">
							<div class="imghoypost">
								<img src="<?php echo base_url("asset/img/posts-image/$post_rec[jonu_post_image]") ?>" width="100%">
								<div class="katlbl"><?php echo $post_rec['jonu_post_view'] ?> <i class="fa fa-eye"></i></div>
							</div>
							<div class="hoypostdes">
								<h2 class="pow-title">
									<a href="<?php echo site_url("post/show/$permalink") ?>"><?php echo $post_rec['jonu_post_title'] ?></a>
								</h2>
							</div>
							<div class="hoysharedbox">									
								<a href="#" class="sharditem"><i class="fa fa-fw fa-twitter"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-facebook"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-down"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-up"></i></a>									
							</div>
						</div>			
					<?php endif; ?>
					<?php $tot_post_num++; ?>
				<?php endforeach; ?>
			</div>

			<?php $tot_post_num = 1; ?>
			<div class="col-md-4 col-sm-4 menpad">
				<?php foreach($post as $post_rec): ?>
					<?php if($tot_post_num > $bts2 && $tot_post_num <= $bts3): ?>					
						<div class="hoybox">
							<div class="imghoypost">
								<img src="<?php echo base_url("asset/img/posts-image/$post_rec[jonu_post_image]") ?>" width="100%">
								<div class="katlbl"><?php echo $post_rec['jonu_post_view'] ?> <i class="fa fa-eye"></i></div>
							</div>
							<div class="hoypostdes">
								<h2 class="pow-title">
									<a href="<?php echo site_url("post/show/$permalink") ?>"><?php echo $post_rec['jonu_post_title'] ?></a>
								</h2>
							</div>
							<div class="hoysharedbox">									
								<a href="#" class="sharditem"><i class="fa fa-fw fa-twitter"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-facebook"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-down"></i></a>
								<a href="#" class="sharditem"><i class="fa fa-fw fa-thumbs-o-up"></i></a>									
							</div>
						</div>			
					<?php endif; ?>
					<?php $tot_post_num++; ?>
				<?php endforeach; ?>
			</div>

			<div id="pow-pagination">
				<?php echo $pagger ?>
			</div>
		</div>
	</div>
</body>
</html>